<link rel="stylesheet" href="../core/resource/weui/weui.css?v=21">
<style type="text/css">

.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:3.6rem}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'main'">
	<div class="fui-content">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
				<div class="carousel-inner" role="listbox" style="height:auto">
					<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.hotel.images">
						
						<a>
							<img src="{{tomedia(item) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 10rem;">
						</a>
					</div>
				</div>
					<style>
							.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
							.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
					</style>
					<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
						<div class="fui-swipe-bullet" ng-repeat="item in pagedata.hotel.images" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
					</div>
		</div>
		<div class="weui_cells_title" style="margin-top:-1.2rem;padding:0 0.5rem">
			<div class="weui_cell weui_pad0">
				<div class="weui_cell_bd weui_pad0" style="width:100%;">
					<label class="weui_label weui_pad0">
					<span>{{pagedata.hotel.title}}</span>
					<span style="float:right"><i class="icon icon-xiangji"></i> {{pagedata.imagenum}}</span>
					</label>
				</div>
			</div>
		</div>
		<div class="weui_cells">
            <a class="weui_cell weui_pad0" href="javascript:;">
                <div class="weui_cell_bd weui_cell_primary" style="padding: 0.6rem 0;">
                    <span style="float:left;width:100%">{{pagedata.hotel.address}}</span>
					<span style="float:left;font-size:0.6rem;color:#999">距离您有{{pagedata.juli}}公里，驾车至此约{{pagedata.time}}分钟。</span>
                </div>
                <div class="weui_cell_ft" ng-click="pagedata.openLocation(pagedata.hotel);">
					<i class="icon icon-ditu" style="color:#19b955"></i>
                </div>
            </a>
        </div>
		<div class="fui-tab-scroll">
				<div ng-class="{'item':1,'on':pagedata.showlist=='goods'}" style="margin-right:1.5rem"><a href="javascript:;" ng-click="pagedata.showlist='goods';">房间</a></div>
				<div ng-class="{'item':1,'on':pagedata.showlist=='pingjia'}" style="margin-right:1.5rem"><a href="javascript:;" ng-click="pagedata.showlist='pingjia';tool.get_list('jy_jd/hotel/getcomments/hotelid='+scope.pagedata.hotel.id,true)">评价 <span class="subtitle">{{pagedata.commentsnum || 0}}</span></a></div>
				<div ng-class="{'item':1,'on':pagedata.showlist=='merch'}" style="position: relative;padding-right:1rem;"><a href="javascript:;" ng-click="pagedata.showlist='merch';">酒店介绍</a> <span class="dot" style="top:0.2rem;background:#ffa000">故事</span></div>
	   </div>
		<div ng-if="pagedata.showlist =='goods'" class="weui_cells">
				<div class="weui_item" ng-repeat="item in pagedata.room">
				<div class="weui_cell">
					<div class="weui_cell_bd" style="padding:0" ng-click="pagedata.showroom=true;pagedata.nowroom=item;pagedata.showchick()">
						 <img style="width:2rem;height:2rem;margin-right:5px;display:block" ng-src="{{tomedia(item.image)}}"/>
					</div>
					<div class="weui_cell_bd weui_cell_primary">
						<span style="float:left">{{item.title}}</span>
						<span ng-if="item.breakfast==1" style="float:left;font-size:0.6rem;color:#999">含早</span>
						<span ng-if="item.breakfast!=1"style="float:left;font-size:0.6rem;color:#999">不含早 </span> 
						
					</div>
					<div class="weui_cell_ft" href="javascript:;" ng-click="toogle(item,'show')">
						<span style="color:red;font-size:0.6rem"> ￥<span style="font-size:0.86rem">{{item.price}}</span><span style="color:#999">起</span></span>
						<i class="icon jinyunicon icon-moreunfold" style="color:#19b955"></i>
					</div>
				</div>
				<div style="background:#FCFCFC" ng-show="item.show">
						<div class="weui_cell"  ng-repeat="taocan in item.taocan">
								<div class="weui_cell_bd weui_cell_primary">
									<span style="float:left">{{taocan.title}}</span>
									<span style="float:left;font-size:0.6rem;color:#999">{{item.mianji}}平米 {{item.chuang}}</span>
								</div>
								<div class="weui_cell_bd weui_cell_primary">
									<span style="float:left;color:red;">剩余{{item.unin}}间</span>
								</div>
								<div class="weui_cell_ft">
									<div ng-show="item.unin>0" style="width:50px;float:right;text-align:center;border-radius:2px;margin-left:5px"  ng-click="access_json('jy_jd/create/main/id='+item.id+'&t='+taocan.key)">
										<div  class="" style="background:#19b955;color:#fff;font-size:0.75rem;padding:0.1rem"><span>订</span></div>
										<div class="" style="background:#F0FFFF;color:#19b955;font-size:0.6rem;padding:0.2rem"><span>在线付</span></div>
									</div>
									<div ng-show="item.unin<=0" style="width:50px;float:right;text-align:center;border-radius:2px;margin-left:5px"  >
										<div class="" style="background:red;color:#fff;font-size:0.68rem"><span>满客</span></div>
									</div>
									<span style="color:red;font-size:0.5rem;float:right;line-height:2.0rem"> ￥<span style="font-size:0.86rem">{{taocan.price}}</span></span>
								</div>
						</div>
					</div>
				</div>
		</div>
		<div ng-if="pagedata.showlist =='pingjia'">
				<div class="fui-cell-group" style="margin-top:0">
				<div class="fui-cell" ng-if="pagedata.commentsnum>0" style="margin-bottom:-0.3rem">
					<div class="fui-cell-text option-selector">评价({{pagedata.commentsnum}})</div>
					<div class="fui-cell-remark noremark">好评度<span style="color:red">{{pagedata.commentsfen.percent}}%</span></div>
				</div>
				<div class="fui-cell">
					<div class="fui-cell-info">
						<span ng-class="{'jylabels jylabel-red':1,'active':pagedata.comments_type=='all'}" style="line-height:0.8rem;padding: 0.1rem 0.6rem;" ng-click="pagedata.getcomments('all');pagedata.comments_type='all'">全部 {{pagedata.commentsnum}}+</span>
						<span ng-class="{'jylabels jylabel-red':1,'active':pagedata.comments_type=='new'}" style="line-height:0.8rem;padding: 0.1rem 0.6rem;" ng-click="pagedata.getcomments('new');pagedata.comments_type='new'">最新的</span>
						<span ng-class="{'jylabels jylabel-red':1,'active':pagedata.comments_type=='percent'}" style="line-height:0.8rem;padding: 0.1rem 0.6rem;" ng-click="pagedata.getcomments('all');pagedata.comments_type='percent'">非常不错 {{pagedata.commentsfen.count.good}}+</span>
						<span ng-class="{'jylabels jylabel-red':1,'active':pagedata.comments_type=='normal_percent'}" style="line-height:0.8rem;padding: 0.1rem 0.6rem;" ng-click="pagedata.getcomments('normal_percent');pagedata.comments_type='normal_percent'">感觉一般 {{pagedata.commentsfen.count.normal}}+</span>
						<span ng-class="{'jylabels jylabel-red':1,'active':pagedata.comments_type=='bad_percent'}" style="line-height:0.8rem;padding: 0.1rem 0.6rem;" ng-click="pagedata.getcomments('bad_percent');pagedata.comments_type='bad_percent'">差评 {{pagedata.commentsfen.count.bad}}+</span>
						<span ng-class="{'jylabels jylabel-red':1,'active':pagedata.comments_type=='pic'}" style="line-height:0.8rem;padding: 0.1rem 0.6rem;" ng-click="pagedata.getcomments('pic');pagedata.comments_type='pic'">有图的 {{pagedata.commentsfen.count.pic}}+</span>
					</div>
				</div>
				<div class="container">
				<!--评论展示区-->
					<div ng-include="sys_html('common/_comments')"></div>
				</div>
				</div>
				 <div class='content-empty' ng-if="pagedata.list.length<1">
					<i class='icon icon-pingjia1'></i><br/>暂时没有任何评价
				</div>
				<div ng-if="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
			</div>
			<div ng-if="pagedata.showlist =='merch'" style="padding:0 0.2rem;margin-bottom:1rem">
				<div class="fui-list-group" style="margin-top:0">  
					<div class="fui-list">
						<div class="fui-list-text">
							<div class="subtitle">简介：{{pagedata.hotel.desc || '暂无店铺描述'}}</div>
						</div>
					</div>
				</div>
				<div class="fui-list-group">
				<div class="fui-list">
						<div class="fui-list-inner">					
							<div class="subtitle">客服热线: </div>
						</div>
				</div>
				<div class="fui-list">
						<a class="fui-list-inner" href="tel:{{pagedata.hotel.tel || pagedata.hotel.mobile}}">					
							<div class="subtitle"><i class="icon icon-tongxun" style="color:#18bc9c"></i> {{pagedata.hotel.tel2 || pagedata.hotel.mobile2}}</div>
						</a>
				</div>
				<div class="fui-list" href="javascript:" ng-click="pagedata.openLocation(pagedata.hotel);">
						<div class="fui-list-inner">					
							<div class="subtitle"><i class="icon jinyunicon icon-ditu" style="color:#18bc9c"></i> {{pagedata.hotel.address}}</div>
						</div>
				</div>
			 </div>
			 <div ng-if="pagedata.hotel.images.length>0" class="weui_cells_title">营业资质</div>
			 <div ng-if="pagedata.hotel.images.length>0" class="weui_cells">
				<div ng-repeat="img in pagedata.hotel.images" class="weui_cell">
					<div style="margin:0.1rem 0">					
						<img style="width:100%" ng-src="{{tomedia(img) || '../core/resource/images/nopic.jpg'}}">
					</div>
				</div>
			 </div>
			 <div class="weui_cells_title">商户详情</div>
			 <div class="weui_cells weui_cells_form">
					<div class="content-block content-images" style="padding:0.5rem 0" ng-bind-html="trust(pagedata.hotel.content)"></div>
			 </div>
			 <div ng-if="pagedata.hotel.remark" class="weui_cells_title">退订规则</div>
			 <div ng-if="pagedata.hotel.remark" class="weui_cells weui_cells_form">
					<div class="content-block content-images" style="padding:0.5rem 0" ng-bind-html="trust(pagedata.hotel.remark)"></div>
			 </div>
		</div>
</div>		
</div>
<div ng-if="pagedata.showroom" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showroom=false"></i>
			<div id="carousel-container2" class="carousel slide" data-role="carousel" data-param-auto="true">
				<div class="carousel-inner" role="listbox" style="height:auto">
					<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.nowroom.images">
						<a>
							<img src="{{tomedia(item) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 20rem;">
						</a>
					</div>
				</div>
					<style>
							.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
							.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
					</style>
					<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
						<div class="fui-swipe-bullet" ng-repeat="item in pagedata.nowroom.images" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
					</div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
scope.pagedata.openLocation=function(item){
	wx.openLocation({
	latitude: item.lat_lng.lat, // 纬度，浮点数，范围为90 ~ -90
	longitude: item.lat_lng.lng, // 经度，浮点数，范围为180 ~ -180。
		name: item.province+item.city+item.district, // 位置名
		address: item.address, // 地址详情说明
		scale: 20, // 地图缩放级别,整形值,范围从1~28。默认为最大
		infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
		success:function(){
			//alert(1111);
		}
	});
}
if(!scope.pagedata.lat_lng && !scope.main.lat_lng){
// 百度地图API功能
window.scope.location(function(re){
	scope.main.lat_lng=re.lat_lng;
	scope.main.pcd=re.addressComponents;
	var lat_lng = re.lat_lng;
	scope.get('jy_jd/hotel/getjuli/id='+scope.pagedata.hotel.id+'&lat='+lat_lng.lat+'&lng='+lat_lng.lng,function(res){
		scope.pagedata.juli=res.juli;
		scope.pagedata.time=res.time;
		scope.$evalAsync();
	});
});
}else{
	var lat_lng=scope.main.lat_lng
	scope.get('jy_jd/hotel/getjuli/id='+scope.pagedata.hotel.id+'&lat='+lat_lng.lat+'&lng='+lat_lng.lng,function(res){
		scope.pagedata.juli=res.juli;
		scope.pagedata.time=res.time;
		scope.$evalAsync();
	});	
}
scope.selecttime = function(){
	/* var myDate = new Date();
	 var params = {
					'plugin':'jy_dish',
					'action':'order',
					'op':'selecttime',
					'data':{},
					'callback':function(data){
							console.log(data)
							if(data.success == 1){
								scope.pagedata.out_time = data.out_time;
							}
					}
		}
		scope.post_json(params);*/
}
</script>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
scope.pagedata.showchick=function(item){
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container2').carousel();
		var mc = new Hammer($('#carousel-container2').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container2').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container2').carousel('prev');
		});
	});
}
</script>
</div>
<div ng-include="sys_html('_footer')"></div>